const marked = require('marked')

/**
 * @type {import('webpack').LoaderDefinitionFunction}
 */
const markdownLoader = (content, sourceMap, additionalData)=>{
  const code = JSON.stringify(marked(content))

  return `module.exports = ${code}`
}

module.exports = markdownLoader
